<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bootstrap Admin</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css" href="__STATIC__/lib/bootstrap/css/bootstrap.css">
    
    <link rel="stylesheet" type="text/css" href="__STATIC__/stylesheets/theme.css">
    <link rel="stylesheet" href="__STATIC__/lib/font-awesome/css/font-awesome.css">

    <script src="__STATIC__/lib/jquery-1.7.2.min.js" type="text/javascript"></script>

    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  </head>

  <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
  <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
  <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
  <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
  <!--[if (gt IE 9)|!(IE)]><!--> 
  <body class=""> 
  <!--<![endif]-->
    


 {include    file="public:header"   /}
    
   
{include file="public:menu"  /}
    
    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">图书类别管理</h1>
        </div>
        
                

        <div class="container-fluid">
            <div class="row-fluid">
                    
<div class="btn-toolbar">
    <a href="typeadd" class="btn btn-primary">添加图书类别</a>

</div>
<div class="well">
    <table class="table">
      <thead>
        <tr>
          <th>编号</th>
          <th>图书类别名称</th>
          <th style="width: 40px;">操作</th>
        </tr>
      </thead>
      <tbody>
     {volist name="type" id="vo"}
        <tr>
          <td>{$i}</td>
          <td>{$vo.typename}</td>  
           <td>
               <a href="#" data-title="Add User" data-toggle="modal" data-target="#example_modal" onclick="jsedit({$vo.tid})"><i class="icon-pencil"></i></a>
              <a href="{:url('deletetype',['tid'=> $vo.tid ])}" ><i class="icon-remove"></i></a>
          </td>
        </tr>
       {/volist}
      </tbody>
    </table>
</div>



 <div id="example_modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">修改视频信息</h3>
      </div>
      <div class="modal-body">
        <p>

          <form method="POST" action="{:url('dotypeedit')}">
            <input type="hidden" name="tid" id="tid_edit">
            <input type="text"  name="typename" id="typename_edit">
          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
              <input type="submit" class="btn btn-default" value="修改">
            </div>
          </div>
        </p>
      </div>
      
    </div>
  </form>



                    
                    <footer>
                        <hr>
                        
                        <p class="pull-right">Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></p>
                        

                        <p>&copy; 2012 <a href="#" target="_blank">Portnine</a></p>
                    </footer>
                    
            </div>
        </div>
    </div>
    



    <script src="__STATIC__/lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
         function jsedit(tid)
             {
     // alert('111');
         $.getJSON("{:url('typeedit')}",{'tid':tid},function(json){
          // alert(json.typename);
          // alert($vid);
           $("#tid_edit").val(tid);
           $("#typename_edit").val(json.typename);
          });
      }
    </script>
    
  </body>
</html>


